package com.yjh.server.controller.miniapp;

import com.yjh.pojo.dto.UserDto;
import com.yjh.pojo.entity.User;
import com.yjh.pojo.vo.R;
import com.yjh.pojo.vo.UserVo;
import com.yjh.server.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mini/ral")
public class MiniLoginController {
    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public R<UserVo> login(@RequestBody User user){
        System.out.println(user);

        UserVo userVo = userService.login(user);
        return R.success(userVo);
//        return R.success();
    }

}
